/*
 * Sandbox for Thesaurus class, which produces a hashmap of
 * string -> multiple Phrase* associations.
 */

#include "../includes/thesaurus.h"
#include "../includes/phrasecollection.h"

#include <QApplication>
#include <QListWidget>

int main(int argc, char* argv[]) {
	QApplication app(argc, argv);

	// load the phrases from 'xml' dir
        PhraseCollection pc("./xml/");
	// construct thesaurus from phrase collection
	Thesaurus t(pc);

	// add matches for 'baby'
        QList<Phrase*> babyPhrases = t.lookup("child");


	// show matches in a list widget
	QListWidget listWidget;
	foreach (Phrase* p, babyPhrases) {
		listWidget.addItem(p->getName());
	}
	listWidget.show();

	return app.exec();
}
